module.exports = {
  preset: '@vue/cli-plugin-unit-jest/presets/typescript-and-babel',
  moduleFileExtensions: ['js', 'jsx', 'json', 'vue', 'ts'],
  // 相当于loader
  transform: {
    '.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$': 'jest-transform-stub'
  },
  transformIgnorePatterns: ['/node_modules/'],
  // 相当于alias
  moduleNameMapper: {
    '^@/(.*)$': '<rootDir>/src/$1'
  },
  // 生成快照
  snapshotSerializers: ['jest-serializer-vue'],
  // 单元测试文件路径
  testMatch: ['**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)'],
  testURL: 'http://localhost:3000/',
}
